package cn.ryh.po;

import org.aspectj.lang.ProceedingJoinPoint;
import org.springframework.stereotype.Component;

@Component(value = "myUser")
public class MyUser {

    public void before(){
        System.out.println("前置增强");
    }

    public void after(){
        System.out.println("后置增加");
    }

    public void around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        //方法之前
        System.out.println("方法执行之前");
        //执行被增强的方法
        proceedingJoinPoint.proceed();
        //方法之后
        System.out.println("方法执行之后");
    }

}
